package org.hxyjs.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author
 */
public class Restaurant implements Serializable,Account {
    private String rno;

    private String rname;

    private String rstate;

    private String rid;

    private String rpwd;

    private String rimg;

    private String riddr;

    private String rbus;

    private String rcal;

    private String remail;

    String salt;//加密用的盐
    Integer isDelete;
    Date createDate;
    Boolean locked = Boolean.FALSE;//是否锁定

    List<AccountRole> accountRoles;


    @Override
    public String getAccountid() {
        return rno;
    }
    @Override
    public String getAccountname() {
        return rname;
    }

    @Override
    public String getPassword() {
        return rpwd;
    }
    @Override
    public String getSalt() {
        return salt;
    }
    public void setSalt(String salt) {
        this.salt = salt;
    }
    @Override
    public Integer getIsDelete() {
        return isDelete;
    }


    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    @Override
    public Date getCreateDate() {
        return createDate;
    }


    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    @Override
    public Boolean getLocked() {
        return locked;
    }


    public void setLocked(Boolean locked) {
        this.locked = locked;
    }

    @Override
    public List<AccountRole> getAccountRoles() {
        return accountRoles;
    }


    public void setAccountRoles(List<AccountRole> accountRoles) {
        this.accountRoles = accountRoles;
    }

    public String getCredentialsSalt()
    {
        return getAccountname() + salt;
    }
//结束    shiro 准备 登录用的 成员变量和方法




    public String getRpic() {
        return rpic;
    }

    public void setRpic(String rpic) {
        this.rpic = rpic;
    }

    private String rpic;

    public List<OrderForm> getOrderForm() {
        return orderForm;
    }

    public void setOrderForm(List<OrderForm> orderForm) {
        this.orderForm = orderForm;
    }

    private String rphone;
    private List<OrderForm> orderForm;
    private static final long serialVersionUID = 1L;

    public String getRno() {
        return rno;
    }

    public void setRno(String rno) {
        this.rno = rno;
    }

    public String getRname() {
        return rname;
    }

    public void setRname(String rname) {
        this.rname = rname;
    }

    public String getRstate() {
        return rstate;
    }

    public void setRstate(String rstate) {
        this.rstate = rstate;
    }

    public String getRid() {
        return rid;
    }

    public void setRid(String rid) {
        this.rid = rid;
    }

    public String getRpwd() {
        return rpwd;
    }

    public void setRpwd(String rpwd) {
        this.rpwd = rpwd;
    }

    public String getRimg() {
        return rimg;
    }

    public void setRimg(String rimg) {
        this.rimg = rimg;
    }

    public String getRiddr() {
        return riddr;
    }

    public void setRiddr(String riddr) {
        this.riddr = riddr;
    }

    public String getRbus() {
        return rbus;
    }

    public void setRbus(String rbus) {
        this.rbus = rbus;
    }

    public String getRcal() {
        return rcal;
    }

    public void setRcal(String rcal) {
        this.rcal = rcal;
    }

    public String getRemail() {
        return remail;
    }

    public void setRemail(String remail) {
        this.remail = remail;
    }

    public String getRphone() {
        return rphone;
    }

    public void setRphone(String rphone) {
        this.rphone = rphone;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Restaurant other = (Restaurant) that;
        return (this.getRno() == null ? other.getRno() == null : this.getRno().equals(other.getRno()))
                && (this.getRname() == null ? other.getRname() == null : this.getRname().equals(other.getRname()))
                && (this.getRstate() == null ? other.getRstate() == null : this.getRstate().equals(other.getRstate()))
                && (this.getRid() == null ? other.getRid() == null : this.getRid().equals(other.getRid()))
                && (this.getRpwd() == null ? other.getRpwd() == null : this.getRpwd().equals(other.getRpwd()))
                && (this.getRimg() == null ? other.getRimg() == null : this.getRimg().equals(other.getRimg()))
                && (this.getRiddr() == null ? other.getRiddr() == null : this.getRiddr().equals(other.getRiddr()))
                && (this.getRbus() == null ? other.getRbus() == null : this.getRbus().equals(other.getRbus()))
                && (this.getRcal() == null ? other.getRcal() == null : this.getRcal().equals(other.getRcal()))
                && (this.getRemail() == null ? other.getRemail() == null : this.getRemail().equals(other.getRemail()))
                && (this.getRphone() == null ? other.getRphone() == null : this.getRphone().equals(other.getRphone()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRno() == null) ? 0 : getRno().hashCode());
        result = prime * result + ((getRname() == null) ? 0 : getRname().hashCode());
        result = prime * result + ((getRstate() == null) ? 0 : getRstate().hashCode());
        result = prime * result + ((getRid() == null) ? 0 : getRid().hashCode());
        result = prime * result + ((getRpwd() == null) ? 0 : getRpwd().hashCode());
        result = prime * result + ((getRimg() == null) ? 0 : getRimg().hashCode());
        result = prime * result + ((getRiddr() == null) ? 0 : getRiddr().hashCode());
        result = prime * result + ((getRbus() == null) ? 0 : getRbus().hashCode());
        result = prime * result + ((getRcal() == null) ? 0 : getRcal().hashCode());
        result = prime * result + ((getRemail() == null) ? 0 : getRemail().hashCode());
        result = prime * result + ((getRphone() == null) ? 0 : getRphone().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", rno=").append(rno);
        sb.append(", rname=").append(rname);
        sb.append(", rstate=").append(rstate);
        sb.append(", rid=").append(rid);
        sb.append(", rpwd=").append(rpwd);
        sb.append(", rimg=").append(rimg);
        sb.append(", riddr=").append(riddr);
        sb.append(", rbus=").append(rbus);
        sb.append(", rcal=").append(rcal);
        sb.append(", remail=").append(remail);
        sb.append(", rphone=").append(rphone);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}